<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    // 父类
    function Person(name) {
        this.name = name
    }

    Person.prototype.sayName = function () {
        console.log(this.name)
    }

    // 子类
    function Man(age) {
        this.age = age
    }

    Man.prototype.sayAge = function () {
        console.log(this.age)
    }

    const manA = new Man('小明', 18)
    console.log(manA);
</script>
</body>
</html>
